function submit(){
    var errStr = checkForm();
    if (errStr != "") {
        errorTips(errStr);
        return false;
    }
    $.ajax({

        type: "post",

        url: $('#login_form').attr("action"),
        // url: 'http://121.196.221.76:8064/app/login',

        data:  $('#login_form').serialize(),

        // dataType: "json",

        success: function(result){
           //这里是解析的json数据   直接返回data
            var data= result;
            if (data.code == 0) {//登录成功
                errorTips("登录成功");
                //这里调用安卓方法
                window.wa.login(JSON.stringify(data.data));
            }else{
                errorTips(data.msg);
            }

        }

    });
}

function errorTips(msg,outTime) {//错误提示
    var node = $('.js_tooltips');
    if(outTime==null) outTime = 2000;
    node.text(msg);
    node.show();
    node.shake(5, 10, 400);
    setTimeout(function(){
        node.fadeOut(500);
    },outTime)
}
function checkForm() {//检查表单
    var account = $("#sg-account").val();
    var password = $("#sg-password").val();
    if (account == null || account.length <= 0) {
        return "用户名不能为空";
    }
    if (password == null || password.length <= 0) {
        return "密码不能为空";
    }
    return "";
}